<%-- 
    Document   : DeleteUser
    Created on : Dec 9, 2011, 5:24:26 AM
    Author     : Michael
--%>

<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% if(session.getAttribute("LoggedIn")==null)
       {
    response.sendRedirect("index.html");
    return;
        }

%>
<!DOCTYPE html>
<%  
Connection conn = null;
try
               {
    conn = new DBClasses.GetConnection().getConnection();
    conn.createStatement().execute("DELETE FROM customer WHERE CustomerID=" + session.getAttribute("UserID"));
    
}
catch(Exception e)
               {
    response.sendRedirect("CustomerList.jsp");
}
finally
               {
    try{
        session.removeAttribute("UserID");
        conn.commit();
        conn.close();
        response.sendRedirect("CustomerList.jsp");
    }
    catch(Exception e)
                       {
        response.sendRedirect("CustomerList.jsp");
    }
}

%>
